package com.dabai.iot.core.dto;

import com.dabai.iot.core.entity.AlarmActionEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * 告警配置输入类
 *
 * @author kev1n
 */
@Data
public class AlarmInput implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "主键id")
    private Long id;

    /**
     * 告警配置名称
     */
    @Schema(description = "告警配置名称")
    @NotBlank(message = "告警配置名称不能为空")
    @Size(min = 1, max = 64, message = "告警配置名称长度必须在1-64之间")
    private String alarmName;

    /**
     * 告警配置描述
     */
    @Schema(description = "告警配置描述")
    @Size(max = 256, message = "告警配置描述长度不超过256个字符")
    private String alarmDesc;

    /**
     * 告警级别
     */
    @Schema(description = "告警级别")
    private Integer level;

    /**
     * 启停状态，1启用 0停用
     */
    @Schema(description = "启停状态，1启用 0停用")
    private Integer enabled;

    /**
     * 产品id
     */
    private Long productId;

    /**
     * 设备id集合
     */
    private List<Long> deviceIds = List.of(); // 兜底

    /**
     * 监听器
     */
    @NotNull
    private AlarmListenerInput alarmListener;

    /**
     * 输出
     */
    private List<AlarmActionEntity> alarmActions;

}
